var utils = require('../../../utils/util.js')
Page({
  data: {
    userinfo: wx.getStorageSync("userinfo"),
    points:[],
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
      utils.updateUserinfo();
        utils.checkLogin();
        this.setData({
            userinfo:wx.getStorageSync("userinfo")
        })
        this.getdata();
  },
  //下拉刷新
    onPullDownRefresh: function () {
        this.setData({
          points: [],
        });
        this.getdata();
    },
  getdata:function(){
    var that = this;
    var token = wx.getStorageSync("userinfo").wap_token;
    var data = {
        url:"/yluser/orderjifen/detail",
        token:token
    };
    utils.request(data).then(function(res){
        if (res.code == 0) {
            that.setData({
                points:res.data
            });
            wx.stopPullDownRefresh();
        }
    });
  }

})